package com.hnevc.chenqi;

/**
 * 字符串的截取和替换，去首位和空格
 */
public class Example02 {
    public static void main(String[] args) {
        String str ="19685652655";
        System.out.println("将手机中间四位用*隐藏"+str.replace("8565","****"));
        String str1 = "102-356-8621-4315";
        String[] strings =str1.split("-");
       for (int i=0;i < strings.length; i++) {
           System.out.println(strings[i]);
       }
        System.out.println("截取手机后四位数"+str.substring(7));
        System.out.println("截取手机中间四位数"+str.substring(3,7));
        String str2 ="    15636987561   ";
        System.out.println("去除两端空格"+str2.trim());
    }
}
